package app.qrcode.browser.ykpixabay.ui.login

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.navigation.NavController
import androidx.navigation.Navigation
import app.qrcode.browser.ykpixabay.R
import kotlinx.android.synthetic.main.fragment_welcome.*

/**
 * Created by YiGo on 2022/4/17.
 */
class WelcomeFragment : Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_welcome, container, false)
    }


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        loginBtn.setOnClickListener {
            val controller: NavController = Navigation.findNavController(it)
            controller.navigate(R.id.action_welcomeFragment_to_enterKeyFragment)
        }
        textView_jump.setOnClickListener {
            val controller: NavController = Navigation.findNavController(it)
            controller.navigate(R.id.action_welcomeFragment_to_viewPicFragment)
        }
    }
}